package com.ruoyi.ncpsy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ncpsy.mapper.NcpsyPesticideInfoMapper;
import com.ruoyi.ncpsy.domain.NcpsyPesticideInfo;
import com.ruoyi.ncpsy.service.INcpsyPesticideInfoService;

/**
 * 农药信息登记Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-24
 */
@Service
public class NcpsyPesticideInfoServiceImpl implements INcpsyPesticideInfoService 
{
    @Autowired
    private NcpsyPesticideInfoMapper ncpsyPesticideInfoMapper;

    /**
     * 查询农药信息登记
     * 
     * @param pesticideId 农药信息登记主键
     * @return 农药信息登记
     */
    @Override
    public NcpsyPesticideInfo selectNcpsyPesticideInfoByPesticideId(Long pesticideId)
    {
        return ncpsyPesticideInfoMapper.selectNcpsyPesticideInfoByPesticideId(pesticideId);
    }

    /**
     * 查询农药信息登记列表
     * 
     * @param ncpsyPesticideInfo 农药信息登记
     * @return 农药信息登记
     */
    @Override
    public List<NcpsyPesticideInfo> selectNcpsyPesticideInfoList(NcpsyPesticideInfo ncpsyPesticideInfo)
    {
        return ncpsyPesticideInfoMapper.selectNcpsyPesticideInfoList(ncpsyPesticideInfo);
    }

    /**
     * 新增农药信息登记
     * 
     * @param ncpsyPesticideInfo 农药信息登记
     * @return 结果
     */
    @Override
    public int insertNcpsyPesticideInfo(NcpsyPesticideInfo ncpsyPesticideInfo)
    {
        ncpsyPesticideInfo.setCreateTime(DateUtils.getNowDate());
        return ncpsyPesticideInfoMapper.insertNcpsyPesticideInfo(ncpsyPesticideInfo);
    }

    /**
     * 修改农药信息登记
     * 
     * @param ncpsyPesticideInfo 农药信息登记
     * @return 结果
     */
    @Override
    public int updateNcpsyPesticideInfo(NcpsyPesticideInfo ncpsyPesticideInfo)
    {
        ncpsyPesticideInfo.setUpdateTime(DateUtils.getNowDate());
        return ncpsyPesticideInfoMapper.updateNcpsyPesticideInfo(ncpsyPesticideInfo);
    }

    /**
     * 批量删除农药信息登记
     * 
     * @param pesticideIds 需要删除的农药信息登记主键
     * @return 结果
     */
    @Override
    public int deleteNcpsyPesticideInfoByPesticideIds(Long[] pesticideIds)
    {
        return ncpsyPesticideInfoMapper.deleteNcpsyPesticideInfoByPesticideIds(pesticideIds);
    }

    /**
     * 删除农药信息登记信息
     * 
     * @param pesticideId 农药信息登记主键
     * @return 结果
     */
    @Override
    public int deleteNcpsyPesticideInfoByPesticideId(Long pesticideId)
    {
        return ncpsyPesticideInfoMapper.deleteNcpsyPesticideInfoByPesticideId(pesticideId);
    }
}
